package com.zhoug.viewpermission;

import java.io.Serializable;
import java.util.List;
import java.util.Objects;

import androidx.annotation.Keep;
import androidx.annotation.NonNull;
import androidx.room.Entity;
import androidx.room.Ignore;
import androidx.room.PrimaryKey;

/**
 * @author: zhoug
 * @since: 2025-06-12
 */
@Keep
@Entity
public class NavigationMenu implements Serializable {
    /**
     * 菜单类型
     */
    public static final int TYPE_MENU = 0;//菜单
    public static final int TYPE_CATALOGUE = 1;//目录
    public static final int TYPE_BUTTON = 2;//按钮
    /**
     * 菜单状态
     */
    public static final int STATUS_NORMAL = 0;//正常
    public static final int STATUS_STOP = 1;//停用




    @NonNull
    @PrimaryKey
    private String id;// 菜单id
    private String parentId;//父菜单id
    private String name;//  菜单名称
    private String code;// 菜单编码
    private String description;//描述
    private String path;//   组件路径
    private String navigation;//   路由路径
    private String icon;//菜单图标
    private int sortOrder;// 排序号
    private boolean visible;//  是否显示
    private boolean deleted;//  是否删除
    private int menuType;//   菜单类型
    private int status;//   状态（0：正常，1：停用）
    private String permissionKey;//  权限标识
    private String systemCode;//
    private String systemName;//

    @Ignore
    private List<NavigationMenu> children;
    //菜单扩展字段,可以存入任何数据
    @Ignore
    private Object obj;

    public NavigationMenu() {
    }

    @NonNull
    public String getId() {
        return id;
    }

    public void setId(@NonNull String id) {
        this.id = id;
    }

    public String getParentId() {
        return parentId;
    }

    public void setParentId(String parentId) {
        this.parentId = parentId;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public String getPath() {
        return path;
    }

    public void setPath(String path) {
        this.path = path;
    }

    public String getNavigation() {
        return navigation;
    }

    public void setNavigation(String navigation) {
        this.navigation = navigation;
    }

    public String getIcon() {
        return icon;
    }

    public void setIcon(String icon) {
        this.icon = icon;
    }

    public int getSortOrder() {
        return sortOrder;
    }

    public void setSortOrder(int sortOrder) {
        this.sortOrder = sortOrder;
    }

    public boolean isVisible() {
        return visible;
    }

    public void setVisible(boolean visible) {
        this.visible = visible;
    }

    public boolean isDeleted() {
        return deleted;
    }

    public void setDeleted(boolean deleted) {
        this.deleted = deleted;
    }

    public int getMenuType() {
        return menuType;
    }

    public void setMenuType(int menuType) {
        this.menuType = menuType;
    }

    public int getStatus() {
        return status;
    }

    public void setStatus(int status) {
        this.status = status;
    }

    public String getPermissionKey() {
        return permissionKey;
    }

    public void setPermissionKey(String permissionKey) {
        this.permissionKey = permissionKey;
    }

    public String getSystemCode() {
        return systemCode;
    }

    public void setSystemCode(String systemCode) {
        this.systemCode = systemCode;
    }

    public String getSystemName() {
        return systemName;
    }

    public void setSystemName(String systemName) {
        this.systemName = systemName;
    }

    public List<NavigationMenu> getChildren() {
        return children;
    }

    public void setChildren(List<NavigationMenu> children) {
        this.children = children;
    }

    public Object getObj() {
        return obj;
    }

    public void setObj(Object obj) {
        this.obj = obj;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        NavigationMenu that = (NavigationMenu) o;
        return Objects.equals(id, that.getId());
    }

}
